package com.brillilab.domain.enums.inventory;

/**
 * 使用记录操作类型枚举
 * 
 * @author lj
 *
 */
public enum InventoryRecordEnum {
	CREATE("新建", 1), SEE("查看", 2), WAREHOUSING("入库", 3), TAKE("取用", 4), EMPTY("清空", 5),
	ADD_SPEC("新增规格", 6), DELETE("删除", 7), UPDATE("修改", 8), DELETE_SPEC("删除规格", 9), RETURN("归还", 10);
	public String key;
	private Integer value;

	private InventoryRecordEnum(String key, Integer value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public static String getKey(Integer value) {
		for (InventoryRecordEnum p : InventoryRecordEnum.values()) {
			if (p.getValue().equals(value)) {
				return p.key;
			}
		}
		return null;
	}

	public Integer getValue() {
		return value;
	}

	public static String getColor(Integer value) {
    	String color = "#D6D009";
    	switch (value) {
			case 1: color = "#03AEE2"; break;
			case 2: color = "#D6D009"; break;
			case 3: color = "#74BC64"; break;
			case 4: color = "#6D06B7"; break;
			case 5: color = "#D91F1D"; break;
			case 6: color = "#05910E"; break;
			case 7: color = "#D91F1D"; break;
			case 8: color = "#0525E0"; break;
			case 9: color = "#EC6941"; break;
			case 10: color = "#C105A7"; break;
		}
    	return color;
    }
}
